package com.common.entity.user;

import lombok.Data;

import java.util.Collection;
import java.util.List;

/**
 * 安全用户
 *
 * @author johnny
 * @create 2020-07-19 下午1:41
 **/
@Data
public class SecurityUser {

    private Collection<GrantedAuthority> authorities;

    private String username;

    private Long userId;

    private String password;

    private List<String> roles;

    public SecurityUser() {
    }

    public SecurityUser(Long userId, String username, String encode, Collection<GrantedAuthority> grantedAuthorities) {
        this.userId = userId;
        this.username = username;
        this.password = encode;
        this.authorities = grantedAuthorities;
    }

    public Collection<GrantedAuthority> getAuthorities() {
        return authorities;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

}